﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Domzs.Extensions
{
    public static class ObjectExtensions
    {
        /// <summary>
        /// Returns 'true' if value is NOT null.
        /// </summary>
        /// <param name="value"></param>
        /// <returns>true if object is not null</returns>
        public static bool Is(this object value)
        {
            return value != null;
        }
        /// <summary>
        /// if value is null 'true' is returned
        /// </summary>
        /// <param name="value"></param>
        /// <returns>returns true if object is null</returns>
        public static bool IsNull(this object value)
        {
            return value == null;
        }

        /// <summary>
        /// Determines whether [is not empty] [the specified value].
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns>
        ///     <c>true</c> if [is not empty] [the specified value]; otherwise, <c>false</c>.
        /// </returns>
        public static bool IsNotEmpty(this object[] value)
        {
            return value != null && value.Length != 0;
        }
    }
}
